package yang.learn.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import yang.learn.dao.ChatRoomDao;
import yang.learn.entity.ChatRoom;
import yang.learn.entity.User;
import yang.learn.service.ChatRoomService;

import java.util.List;

@Service
public class ChatRoomServiceImpl implements ChatRoomService {

    @Autowired(required = false)
    private ChatRoomDao chatRoomDao;

    public void add(ChatRoom chatRoom){
        chatRoomDao.add(chatRoom);
    }
    public void del(ChatRoom chatRoom){
        chatRoomDao.del(chatRoom);
    }
    public void change(ChatRoom chatRoom){
        chatRoomDao.change(chatRoom);
    }
    public ChatRoom queryId(ChatRoom chatRoom){
        return  chatRoomDao.queryId(chatRoom);
    }
    public List<ChatRoom> queryAll(User user){
        return  chatRoomDao.queryAll(user);
    }

}
